{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import os\n",
    "import random"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['00437.xml',\n",
       " '00751.xml',\n",
       " '06216.xml',\n",
       " '00410.xml',\n",
       " '03722.xml',\n",
       " '05754.xml',\n",
       " '12020.xml',\n",
       " '05645.xml',\n",
       " '04217.xml',\n",
       " '01714.xml',\n",
       " '10142.xml',\n",
       " '12164.xml',\n",
       " '13958.xml',\n",
       " '12737.xml',\n",
       " '01352.xml',\n",
       " '13617.xml',\n",
       " '13977.xml',\n",
       " '11095.xml',\n",
       " '14651.xml',\n",
       " '03171.xml',\n",
       " '10792.xml',\n",
       " '00209.xml',\n",
       " '05203.xml',\n",
       " '02962.xml',\n",
       " '05898.xml',\n",
       " '11265.xml',\n",
       " '12084.xml',\n",
       " '05180.xml',\n",
       " '10206.xml',\n",
       " '05413.xml',\n",
       " '13744.xml',\n",
       " '13016.xml',\n",
       " '11574.xml',\n",
       " '06411.xml',\n",
       " '11885.xml',\n",
       " '14970.xml',\n",
       " '00963.xml',\n",
       " '00711.xml',\n",
       " '02778.xml',\n",
       " '11336.xml',\n",
       " '04660.xml',\n",
       " '01258.xml',\n",
       " '13627.xml',\n",
       " '11380.xml',\n",
       " '11623.xml',\n",
       " '04071.xml',\n",
       " '00688.xml',\n",
       " '11934.xml',\n",
       " '14961.xml',\n",
       " '03177.xml',\n",
       " '10967.xml',\n",
       " '05356.xml',\n",
       " '05058.xml',\n",
       " '04140.xml',\n",
       " '12798.xml',\n",
       " '05175.xml',\n",
       " '15043.xml',\n",
       " '04940.xml',\n",
       " '14722.xml',\n",
       " '03650.xml',\n",
       " '12060.xml',\n",
       " '10892.xml',\n",
       " '04769.xml',\n",
       " '14685.xml',\n",
       " '13926.xml',\n",
       " '06172.xml',\n",
       " '05079.xml',\n",
       " '05461.xml',\n",
       " '01566.xml',\n",
       " '11636.xml',\n",
       " '03859.xml',\n",
       " '03537.xml',\n",
       " '14054.xml',\n",
       " '04765.xml',\n",
       " '14168.xml',\n",
       " '06356.xml',\n",
       " '06381.xml',\n",
       " '03747.xml',\n",
       " '13590.xml',\n",
       " '02649.xml',\n",
       " '01719.xml',\n",
       " '10925.xml',\n",
       " '02775.xml',\n",
       " '01834.xml',\n",
       " '11687.xml',\n",
       " '10754.xml',\n",
       " '11063.xml',\n",
       " '10064.xml',\n",
       " '01588.xml',\n",
       " '11381.xml',\n",
       " '05661.xml',\n",
       " '02838.xml',\n",
       " '10426.xml',\n",
       " '14016.xml',\n",
       " '12206.xml',\n",
       " '01856.xml',\n",
       " '05782.xml',\n",
       " '06376.xml',\n",
       " '06515.xml',\n",
       " '03345.xml',\n",
       " '14069.xml',\n",
       " '06011.xml',\n",
       " '03268.xml',\n",
       " '14990.xml',\n",
       " '12077.xml',\n",
       " '05481.xml',\n",
       " '13711.xml',\n",
       " '01261.xml',\n",
       " '11362.xml',\n",
       " '04384.xml',\n",
       " '11251.xml',\n",
       " '00298.xml',\n",
       " '04948.xml',\n",
       " '10915.xml',\n",
       " '05128.xml',\n",
       " '01823.xml',\n",
       " '13665.xml',\n",
       " '02866.xml',\n",
       " '10125.xml',\n",
       " '00677.xml',\n",
       " '14526.xml',\n",
       " '11797.xml',\n",
       " '05967.xml',\n",
       " '14338.xml',\n",
       " '11253.xml',\n",
       " '05752.xml',\n",
       " '04227.xml',\n",
       " '01120.xml',\n",
       " '14202.xml',\n",
       " '10178.xml',\n",
       " '05064.xml',\n",
       " '14061.xml',\n",
       " '05955.xml',\n",
       " '12550.xml',\n",
       " '05917.xml',\n",
       " '00703.xml',\n",
       " '11841.xml',\n",
       " '01251.xml',\n",
       " '03580.xml',\n",
       " '10126.xml',\n",
       " '10284.xml',\n",
       " '01514.xml',\n",
       " '04193.xml',\n",
       " '01207.xml',\n",
       " '02418.xml',\n",
       " '13710.xml',\n",
       " '05386.xml',\n",
       " '14865.xml',\n",
       " '05290.xml',\n",
       " '06386.xml',\n",
       " '04693.xml',\n",
       " '14328.xml',\n",
       " '04713.xml',\n",
       " '02291.xml',\n",
       " '06397.xml',\n",
       " '00678.xml',\n",
       " '06152.xml',\n",
       " '01898.xml',\n",
       " '01593.xml',\n",
       " '04017.xml',\n",
       " '14630.xml',\n",
       " '15018.xml',\n",
       " '00578.xml',\n",
       " '00021.xml',\n",
       " '05038.xml',\n",
       " '02921.xml',\n",
       " '02848.xml',\n",
       " '11936.xml',\n",
       " '03702.xml',\n",
       " '02237.xml',\n",
       " '00619.xml',\n",
       " '01371.xml',\n",
       " '02280.xml',\n",
       " '05262.xml',\n",
       " '05865.xml',\n",
       " '14433.xml',\n",
       " '13749.xml',\n",
       " '14453.xml',\n",
       " '04497.xml',\n",
       " '12098.xml',\n",
       " '04817.xml',\n",
       " '00528.xml',\n",
       " '11065.xml',\n",
       " '00916.xml',\n",
       " '00435.xml',\n",
       " '04106.xml',\n",
       " '13586.xml',\n",
       " '12598.xml',\n",
       " '10193.xml',\n",
       " '12634.xml',\n",
       " '05597.xml',\n",
       " '06428.xml',\n",
       " '03562.xml',\n",
       " '05624.xml',\n",
       " '04893.xml',\n",
       " '02308.xml',\n",
       " '00794.xml',\n",
       " '02041.xml',\n",
       " '00287.xml',\n",
       " '11230.xml',\n",
       " '06280.xml',\n",
       " '01277.xml',\n",
       " '02050.xml',\n",
       " '14336.xml',\n",
       " '03299.xml',\n",
       " '10285.xml',\n",
       " '02655.xml',\n",
       " '14359.xml',\n",
       " '02940.xml',\n",
       " '02603.xml',\n",
       " '15032.xml',\n",
       " '01416.xml',\n",
       " '04278.xml',\n",
       " '04767.xml',\n",
       " '04241.xml',\n",
       " '05528.xml',\n",
       " '02552.xml',\n",
       " '02961.xml',\n",
       " '01721.xml',\n",
       " '11116.xml',\n",
       " '10121.xml',\n",
       " '06417.xml',\n",
       " '03771.xml',\n",
       " '05674.xml',\n",
       " '12662.xml',\n",
       " '05585.xml',\n",
       " '12811.xml',\n",
       " '14766.xml',\n",
       " '13602.xml',\n",
       " '02336.xml',\n",
       " '10261.xml',\n",
       " '10639.xml',\n",
       " '02005.xml',\n",
       " '11873.xml',\n",
       " '00758.xml',\n",
       " '11611.xml',\n",
       " '03182.xml',\n",
       " '06340.xml',\n",
       " '12855.xml',\n",
       " '00376.xml',\n",
       " '00931.xml',\n",
       " '12200.xml',\n",
       " '11417.xml',\n",
       " '05101.xml',\n",
       " '12121.xml',\n",
       " '00968.xml',\n",
       " '02827.xml',\n",
       " '10907.xml',\n",
       " '05460.xml',\n",
       " '00135.xml',\n",
       " '10704.xml',\n",
       " '06408.xml',\n",
       " '00662.xml',\n",
       " '02947.xml',\n",
       " '01985.xml',\n",
       " '13523.xml',\n",
       " '15007.xml',\n",
       " '12693.xml',\n",
       " '05145.xml',\n",
       " '05311.xml',\n",
       " '04513.xml',\n",
       " '03717.xml',\n",
       " '10573.xml',\n",
       " '14853.xml',\n",
       " '03374.xml',\n",
       " '04700.xml',\n",
       " '11448.xml',\n",
       " '00818.xml',\n",
       " '05798.xml',\n",
       " '04087.xml',\n",
       " '04443.xml',\n",
       " '13987.xml',\n",
       " '02320.xml',\n",
       " '10810.xml',\n",
       " '03785.xml',\n",
       " '11816.xml',\n",
       " '12225.xml',\n",
       " '05751.xml',\n",
       " '03776.xml',\n",
       " '12506.xml',\n",
       " '10358.xml',\n",
       " '00121.xml',\n",
       " '01035.xml',\n",
       " '12134.xml',\n",
       " '02935.xml',\n",
       " '00167.xml',\n",
       " '04107.xml',\n",
       " '02074.xml',\n",
       " '06341.xml',\n",
       " '00006.xml',\n",
       " '10959.xml',\n",
       " '03716.xml',\n",
       " '04717.xml',\n",
       " '02727.xml',\n",
       " '10643.xml',\n",
       " '05521.xml',\n",
       " '12035.xml',\n",
       " '10163.xml',\n",
       " '03788.xml',\n",
       " '01732.xml',\n",
       " '10865.xml',\n",
       " '00453.xml',\n",
       " '11525.xml',\n",
       " '11794.xml',\n",
       " '01990.xml',\n",
       " '02196.xml',\n",
       " '00236.xml',\n",
       " '14656.xml',\n",
       " '10807.xml',\n",
       " '14716.xml',\n",
       " '05447.xml',\n",
       " '01668.xml',\n",
       " '04048.xml',\n",
       " '12115.xml',\n",
       " '04373.xml',\n",
       " '04155.xml',\n",
       " '05878.xml',\n",
       " '10152.xml',\n",
       " '01323.xml',\n",
       " '12065.xml',\n",
       " '05391.xml',\n",
       " '10402.xml',\n",
       " '02768.xml',\n",
       " '14313.xml',\n",
       " '02112.xml',\n",
       " '14423.xml',\n",
       " '00559.xml',\n",
       " '10872.xml',\n",
       " '14301.xml',\n",
       " '12055.xml',\n",
       " '01282.xml',\n",
       " '10078.xml',\n",
       " '11945.xml',\n",
       " '02525.xml',\n",
       " '10453.xml',\n",
       " '04474.xml',\n",
       " '03576.xml',\n",
       " '11006.xml',\n",
       " '04043.xml',\n",
       " '01164.xml',\n",
       " '05165.xml',\n",
       " '01767.xml',\n",
       " '10591.xml',\n",
       " '05567.xml',\n",
       " '00354.xml',\n",
       " '11904.xml',\n",
       " '05104.xml',\n",
       " '11573.xml',\n",
       " '06142.xml',\n",
       " '06053.xml',\n",
       " '00155.xml',\n",
       " '11669.xml',\n",
       " '10699.xml',\n",
       " '14428.xml',\n",
       " '05206.xml',\n",
       " '14554.xml',\n",
       " '04099.xml',\n",
       " '14509.xml',\n",
       " '14804.xml',\n",
       " '04896.xml',\n",
       " '14497.xml',\n",
       " '11711.xml',\n",
       " '06111.xml',\n",
       " '12539.xml',\n",
       " '03436.xml',\n",
       " '12022.xml',\n",
       " '11870.xml',\n",
       " '14911.xml',\n",
       " '05076.xml',\n",
       " '06269.xml',\n",
       " '04429.xml',\n",
       " '01290.xml',\n",
       " '14701.xml',\n",
       " '01299.xml',\n",
       " '05866.xml',\n",
       " '12009.xml',\n",
       " '11068.xml',\n",
       " '00182.xml',\n",
       " '01146.xml',\n",
       " '12738.xml',\n",
       " '05795.xml',\n",
       " '12974.xml',\n",
       " '13026.xml',\n",
       " '11693.xml',\n",
       " '02966.xml',\n",
       " '06031.xml',\n",
       " '01735.xml',\n",
       " '05807.xml',\n",
       " '10726.xml',\n",
       " '01018.xml',\n",
       " '10213.xml',\n",
       " '11940.xml',\n",
       " '02267.xml',\n",
       " '02195.xml',\n",
       " '04952.xml',\n",
       " '01546.xml',\n",
       " '05351.xml',\n",
       " '06353.xml',\n",
       " '03700.xml',\n",
       " '14036.xml',\n",
       " '05090.xml',\n",
       " '01174.xml',\n",
       " '05783.xml',\n",
       " '14707.xml',\n",
       " '13913.xml',\n",
       " '05665.xml',\n",
       " '05166.xml',\n",
       " '14492.xml',\n",
       " '10308.xml',\n",
       " '14588.xml',\n",
       " '12815.xml',\n",
       " '03693.xml',\n",
       " '01406.xml',\n",
       " '12637.xml',\n",
       " '05698.xml',\n",
       " '03424.xml',\n",
       " '06036.xml',\n",
       " '02294.xml',\n",
       " '11426.xml',\n",
       " '14605.xml',\n",
       " '10534.xml',\n",
       " '06055.xml',\n",
       " '01942.xml',\n",
       " '14324.xml',\n",
       " '03326.xml',\n",
       " '03756.xml',\n",
       " '11209.xml',\n",
       " '10991.xml',\n",
       " '05194.xml',\n",
       " '00313.xml',\n",
       " '11290.xml',\n",
       " '02206.xml',\n",
       " '00638.xml',\n",
       " '05078.xml',\n",
       " '12816.xml',\n",
       " '11713.xml',\n",
       " '11294.xml',\n",
       " '06521.xml',\n",
       " '04018.xml',\n",
       " '03349.xml',\n",
       " '04592.xml',\n",
       " '13713.xml',\n",
       " '00550.xml',\n",
       " '04953.xml',\n",
       " '02494.xml',\n",
       " '04256.xml',\n",
       " '12254.xml',\n",
       " '10714.xml',\n",
       " '05940.xml',\n",
       " '11187.xml',\n",
       " '01432.xml',\n",
       " '11761.xml',\n",
       " '02029.xml',\n",
       " '00837.xml',\n",
       " '05192.xml',\n",
       " '12667.xml',\n",
       " '04502.xml',\n",
       " '11530.xml',\n",
       " '03045.xml',\n",
       " '01725.xml',\n",
       " '06134.xml',\n",
       " '06463.xml',\n",
       " '11143.xml',\n",
       " '11180.xml',\n",
       " '04732.xml',\n",
       " '14127.xml',\n",
       " '01160.xml',\n",
       " '11388.xml',\n",
       " '04549.xml',\n",
       " '06272.xml',\n",
       " '13921.xml',\n",
       " '05004.xml',\n",
       " '12153.xml',\n",
       " '11292.xml',\n",
       " '02463.xml',\n",
       " '01453.xml',\n",
       " '03602.xml',\n",
       " '14229.xml',\n",
       " '11705.xml',\n",
       " '14971.xml',\n",
       " '10489.xml',\n",
       " '06176.xml',\n",
       " '04188.xml',\n",
       " '01429.xml',\n",
       " '12518.xml',\n",
       " '03369.xml',\n",
       " '05444.xml',\n",
       " '01148.xml',\n",
       " '11978.xml',\n",
       " '10642.xml',\n",
       " '05295.xml',\n",
       " '01072.xml',\n",
       " '06081.xml',\n",
       " '11545.xml',\n",
       " '11856.xml',\n",
       " '14128.xml',\n",
       " '10663.xml',\n",
       " '11351.xml',\n",
       " '14867.xml',\n",
       " '01206.xml',\n",
       " '12796.xml',\n",
       " '14642.xml',\n",
       " '11685.xml',\n",
       " '00438.xml',\n",
       " '01984.xml',\n",
       " '13030.xml',\n",
       " '10241.xml',\n",
       " '14764.xml',\n",
       " '04060.xml',\n",
       " '12233.xml',\n",
       " '06208.xml',\n",
       " '01363.xml',\n",
       " '10553.xml',\n",
       " '12656.xml',\n",
       " '00054.xml',\n",
       " '11720.xml',\n",
       " '04648.xml',\n",
       " '04098.xml',\n",
       " '00603.xml',\n",
       " '03322.xml',\n",
       " '02378.xml',\n",
       " '12749.xml',\n",
       " '11439.xml',\n",
       " '05772.xml',\n",
       " '12263.xml',\n",
       " '01007.xml',\n",
       " '00570.xml',\n",
       " '04263.xml',\n",
       " '02824.xml',\n",
       " '04966.xml',\n",
       " '05986.xml',\n",
       " '04442.xml',\n",
       " '13509.xml',\n",
       " '02564.xml',\n",
       " '05668.xml',\n",
       " '06019.xml',\n",
       " '03387.xml',\n",
       " '01545.xml',\n",
       " '10256.xml',\n",
       " '12651.xml',\n",
       " '00227.xml',\n",
       " '04714.xml',\n",
       " '10604.xml',\n",
       " '11026.xml',\n",
       " '05100.xml',\n",
       " '14906.xml',\n",
       " '01412.xml',\n",
       " '12978.xml',\n",
       " '10688.xml',\n",
       " '00418.xml',\n",
       " '00279.xml',\n",
       " '13727.xml',\n",
       " '11993.xml',\n",
       " '14699.xml',\n",
       " '01356.xml',\n",
       " '02261.xml',\n",
       " '13890.xml',\n",
       " '10442.xml',\n",
       " '04585.xml',\n",
       " '12105.xml',\n",
       " '00910.xml',\n",
       " '14213.xml',\n",
       " '02260.xml',\n",
       " '02622.xml',\n",
       " '10144.xml',\n",
       " '14798.xml',\n",
       " '04625.xml',\n",
       " '05102.xml',\n",
       " '06503.xml',\n",
       " '12702.xml',\n",
       " '06187.xml',\n",
       " '04090.xml',\n",
       " '10759.xml',\n",
       " '10309.xml',\n",
       " '11865.xml',\n",
       " '02728.xml',\n",
       " '14484.xml',\n",
       " '06458.xml',\n",
       " '11098.xml',\n",
       " '14862.xml',\n",
       " '12960.xml',\n",
       " '12966.xml',\n",
       " '04998.xml',\n",
       " '05943.xml',\n",
       " '06365.xml',\n",
       " '01483.xml',\n",
       " '12897.xml',\n",
       " '06537.xml',\n",
       " '13680.xml',\n",
       " '06167.xml',\n",
       " '11195.xml',\n",
       " '14925.xml',\n",
       " '10970.xml',\n",
       " '12602.xml',\n",
       " '05363.xml',\n",
       " '02842.xml',\n",
       " '01829.xml',\n",
       " '11032.xml',\n",
       " '01246.xml',\n",
       " '04564.xml',\n",
       " '04912.xml',\n",
       " '04679.xml',\n",
       " '14545.xml',\n",
       " '03581.xml',\n",
       " '10404.xml',\n",
       " '00981.xml',\n",
       " '13838.xml',\n",
       " '01737.xml',\n",
       " '01344.xml',\n",
       " '01064.xml',\n",
       " '11551.xml',\n",
       " '01561.xml',\n",
       " '05873.xml',\n",
       " '10338.xml',\n",
       " '00694.xml',\n",
       " '06139.xml',\n",
       " '04554.xml',\n",
       " '11998.xml',\n",
       " '00339.xml',\n",
       " '13785.xml',\n",
       " '12211.xml',\n",
       " '04820.xml',\n",
       " '06101.xml',\n",
       " '05811.xml',\n",
       " '12579.xml',\n",
       " '05002.xml',\n",
       " '13573.xml',\n",
       " '06333.xml',\n",
       " '03298.xml',\n",
       " '05241.xml',\n",
       " '05240.xml',\n",
       " '04195.xml',\n",
       " '06094.xml',\n",
       " '14118.xml',\n",
       " '02895.xml',\n",
       " '11747.xml',\n",
       " '01855.xml',\n",
       " '12882.xml',\n",
       " '05510.xml',\n",
       " '05270.xml',\n",
       " '13610.xml',\n",
       " '01676.xml',\n",
       " '11074.xml',\n",
       " '01908.xml',\n",
       " '01630.xml',\n",
       " '04462.xml',\n",
       " '06505.xml',\n",
       " '13779.xml',\n",
       " '04691.xml',\n",
       " '02599.xml',\n",
       " '06098.xml',\n",
       " '14604.xml',\n",
       " '05869.xml',\n",
       " '13763.xml',\n",
       " '04758.xml',\n",
       " '14599.xml',\n",
       " '00924.xml',\n",
       " '03428.xml',\n",
       " '02331.xml',\n",
       " '15011.xml',\n",
       " '14205.xml',\n",
       " '14160.xml',\n",
       " '11067.xml',\n",
       " '03114.xml',\n",
       " '13800.xml',\n",
       " '10470.xml',\n",
       " '10531.xml',\n",
       " '14933.xml',\n",
       " '11534.xml',\n",
       " '01157.xml',\n",
       " '11494.xml',\n",
       " '01269.xml',\n",
       " '06360.xml',\n",
       " '00572.xml',\n",
       " '11947.xml',\n",
       " '12644.xml',\n",
       " '00403.xml',\n",
       " '14690.xml',\n",
       " '12513.xml',\n",
       " '13905.xml',\n",
       " '03250.xml',\n",
       " '04182.xml',\n",
       " '00686.xml',\n",
       " '10809.xml',\n",
       " '04890.xml',\n",
       " '11244.xml',\n",
       " '15010.xml',\n",
       " '04412.xml',\n",
       " '11908.xml',\n",
       " '04973.xml',\n",
       " '06292.xml',\n",
       " '12959.xml',\n",
       " '03131.xml',\n",
       " '03638.xml',\n",
       " '01214.xml',\n",
       " '12555.xml',\n",
       " '11367.xml',\n",
       " '06196.xml',\n",
       " '10693.xml',\n",
       " '00691.xml',\n",
       " '14831.xml',\n",
       " '02386.xml',\n",
       " '05601.xml',\n",
       " '12639.xml',\n",
       " '04532.xml',\n",
       " '04425.xml',\n",
       " '06339.xml',\n",
       " '06482.xml',\n",
       " '13997.xml',\n",
       " '00020.xml',\n",
       " '05766.xml',\n",
       " '05721.xml',\n",
       " '02064.xml',\n",
       " '04387.xml',\n",
       " '13547.xml',\n",
       " '03843.xml',\n",
       " '02557.xml',\n",
       " '00166.xml',\n",
       " '11511.xml',\n",
       " '05254.xml',\n",
       " '10138.xml',\n",
       " '02111.xml',\n",
       " '10341.xml',\n",
       " '14221.xml',\n",
       " '11970.xml',\n",
       " '02262.xml',\n",
       " '04316.xml',\n",
       " '10563.xml',\n",
       " '10175.xml',\n",
       " '12218.xml',\n",
       " '11827.xml',\n",
       " '10555.xml',\n",
       " '03586.xml',\n",
       " '01785.xml',\n",
       " '11505.xml',\n",
       " '01276.xml',\n",
       " '11048.xml',\n",
       " '04627.xml',\n",
       " '02539.xml',\n",
       " '03619.xml',\n",
       " '04975.xml',\n",
       " '03413.xml',\n",
       " '00404.xml',\n",
       " '13982.xml',\n",
       " '03357.xml',\n",
       " '11948.xml',\n",
       " '02963.xml',\n",
       " '14198.xml',\n",
       " '13038.xml',\n",
       " '00281.xml',\n",
       " '14388.xml',\n",
       " '01200.xml',\n",
       " '05997.xml',\n",
       " '14411.xml',\n",
       " '12990.xml',\n",
       " '02283.xml',\n",
       " '10638.xml',\n",
       " '02344.xml',\n",
       " '13771.xml',\n",
       " '04086.xml',\n",
       " '10620.xml',\n",
       " '04674.xml',\n",
       " '00217.xml',\n",
       " '10743.xml',\n",
       " '04745.xml',\n",
       " '11256.xml',\n",
       " '03679.xml',\n",
       " '14621.xml',\n",
       " '00514.xml',\n",
       " '05922.xml',\n",
       " '13998.xml',\n",
       " '14073.xml',\n",
       " '05279.xml',\n",
       " '13585.xml',\n",
       " '01419.xml',\n",
       " '05456.xml',\n",
       " '04152.xml',\n",
       " '04264.xml',\n",
       " '04640.xml',\n",
       " '06410.xml',\n",
       " '11767.xml',\n",
       " '06104.xml',\n",
       " '03769.xml',\n",
       " '10141.xml',\n",
       " '03631.xml',\n",
       " '14909.xml',\n",
       " '05382.xml',\n",
       " '05259.xml',\n",
       " '10050.xml',\n",
       " '13514.xml',\n",
       " '03319.xml',\n",
       " '12113.xml',\n",
       " '04550.xml',\n",
       " '14728.xml',\n",
       " '11650.xml',\n",
       " '04926.xml',\n",
       " '13900.xml',\n",
       " '11772.xml',\n",
       " '04496.xml',\n",
       " '02889.xml',\n",
       " '14481.xml',\n",
       " '13934.xml',\n",
       " '01679.xml',\n",
       " '14769.xml',\n",
       " '02835.xml',\n",
       " '10270.xml',\n",
       " '05928.xml',\n",
       " '10070.xml',\n",
       " '01806.xml',\n",
       " '14008.xml',\n",
       " '11212.xml',\n",
       " '14462.xml',\n",
       " '02714.xml',\n",
       " '05361.xml',\n",
       " '01956.xml',\n",
       " '05046.xml',\n",
       " '05140.xml',\n",
       " '12041.xml',\n",
       " '03282.xml',\n",
       " '02387.xml',\n",
       " '02522.xml',\n",
       " '13825.xml',\n",
       " '11303.xml',\n",
       " '00341.xml',\n",
       " '03552.xml',\n",
       " '12561.xml',\n",
       " '10837.xml',\n",
       " '01475.xml',\n",
       " '11665.xml',\n",
       " '01068.xml',\n",
       " '12935.xml',\n",
       " '10226.xml',\n",
       " '10723.xml',\n",
       " '04517.xml',\n",
       " '11664.xml',\n",
       " '14836.xml',\n",
       " '03303.xml',\n",
       " '11798.xml',\n",
       " '02716.xml',\n",
       " '05509.xml',\n",
       " '10384.xml',\n",
       " '10129.xml',\n",
       " '13863.xml',\n",
       " '02355.xml',\n",
       " '02263.xml',\n",
       " '05124.xml',\n",
       " '11836.xml',\n",
       " '01704.xml',\n",
       " '12044.xml',\n",
       " '10368.xml',\n",
       " '01322.xml',\n",
       " '05630.xml',\n",
       " '14281.xml',\n",
       " '00396.xml',\n",
       " '01989.xml',\n",
       " '05697.xml',\n",
       " '01213.xml',\n",
       " '02154.xml',\n",
       " '02296.xml',\n",
       " '14017.xml',\n",
       " '14736.xml',\n",
       " '03609.xml',\n",
       " '14580.xml',\n",
       " '14077.xml',\n",
       " '00194.xml',\n",
       " '12012.xml',\n",
       " '14351.xml',\n",
       " '06084.xml',\n",
       " '06174.xml',\n",
       " '01086.xml',\n",
       " '04213.xml',\n",
       " '03572.xml',\n",
       " '11460.xml',\n",
       " '02984.xml',\n",
       " '00701.xml',\n",
       " '03414.xml',\n",
       " '11831.xml',\n",
       " '13742.xml',\n",
       " '04184.xml',\n",
       " '02202.xml',\n",
       " '00862.xml',\n",
       " '10161.xml',\n",
       " '11779.xml',\n",
       " '11590.xml',\n",
       " '04455.xml',\n",
       " '13817.xml',\n",
       " '05300.xml',\n",
       " '10008.xml',\n",
       " '02158.xml',\n",
       " '02821.xml',\n",
       " '00730.xml',\n",
       " '13759.xml',\n",
       " '11235.xml',\n",
       " '01410.xml',\n",
       " '06035.xml',\n",
       " '11731.xml',\n",
       " '11406.xml',\n",
       " '12922.xml',\n",
       " '01397.xml',\n",
       " '15005.xml',\n",
       " '10071.xml',\n",
       " '02036.xml',\n",
       " '04909.xml',\n",
       " '11474.xml',\n",
       " '00402.xml',\n",
       " '14006.xml',\n",
       " '04807.xml',\n",
       " '01444.xml',\n",
       " '04649.xml',\n",
       " '00815.xml',\n",
       " '02852.xml',\n",
       " '06256.xml',\n",
       " '00833.xml',\n",
       " '05740.xml',\n",
       " '00328.xml',\n",
       " '05978.xml',\n",
       " '10387.xml',\n",
       " '11422.xml',\n",
       " '14091.xml',\n",
       " '05400.xml',\n",
       " '01260.xml',\n",
       " '03614.xml',\n",
       " '12846.xml',\n",
       " '04934.xml',\n",
       " '00948.xml',\n",
       " '11326.xml',\n",
       " '10511.xml',\n",
       " '00525.xml',\n",
       " '05429.xml',\n",
       " '05574.xml',\n",
       " '05918.xml',\n",
       " '10517.xml',\n",
       " '13576.xml',\n",
       " '03883.xml',\n",
       " '14049.xml',\n",
       " '11788.xml',\n",
       " '05831.xml',\n",
       " '04847.xml',\n",
       " '03587.xml',\n",
       " '02470.xml',\n",
       " '12696.xml',\n",
       " '14151.xml',\n",
       " '13033.xml',\n",
       " '14627.xml',\n",
       " '03154.xml',\n",
       " '11848.xml',\n",
       " '02130.xml',\n",
       " '13707.xml',\n",
       " '12072.xml',\n",
       " '13846.xml',\n",
       " '10764.xml',\n",
       " '11313.xml',\n",
       " '05870.xml',\n",
       " '01179.xml',\n",
       " '03721.xml',\n",
       " '11570.xml',\n",
       " '01562.xml',\n",
       " '03662.xml',\n",
       " '14027.xml',\n",
       " '14672.xml',\n",
       " '05890.xml',\n",
       " '12954.xml',\n",
       " '14432.xml',\n",
       " '14365.xml',\n",
       " '05979.xml',\n",
       " '12669.xml',\n",
       " '12135.xml',\n",
       " '02107.xml',\n",
       " '00536.xml',\n",
       " '14694.xml',\n",
       " '03196.xml',\n",
       " '11440.xml',\n",
       " '11898.xml',\n",
       " '06439.xml',\n",
       " '02288.xml',\n",
       " '13783.xml',\n",
       " '04757.xml',\n",
       " '10749.xml',\n",
       " '10891.xml',\n",
       " '10675.xml',\n",
       " '01128.xml',\n",
       " '13951.xml',\n",
       " '04794.xml',\n",
       " '01465.xml',\n",
       " '13535.xml',\n",
       " '05591.xml',\n",
       " '14272.xml',\n",
       " '10997.xml',\n",
       " '05677.xml',\n",
       " '11368.xml',\n",
       " '05130.xml',\n",
       " '12147.xml',\n",
       " '01489.xml',\n",
       " '05863.xml',\n",
       " '12141.xml',\n",
       " '14548.xml',\n",
       " '10593.xml',\n",
       " '01307.xml',\n",
       " '02615.xml',\n",
       " '10111.xml',\n",
       " ...]"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "trainval_percent = 0.1\n",
    "train_percent = 0.9\n",
    "xmlfilepath = 'Annotations'\n",
    "txtsavepath = 'ImageSets\\Main'\n",
    "total_xml = os.listdir(xmlfilepath)\n",
    "total_xml"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "10188"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "num = len(total_xml)\n",
    "num"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "range(0, 10188)\n",
      "1018\n",
      "916\n"
     ]
    }
   ],
   "source": [
    "list = range(num)\n",
    "print(list)\n",
    "tv = int(num * trainval_percent)\n",
    "print(tv)\n",
    "tr = int(tv * train_percent)\n",
    "print(tr)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[3546,\n",
       " 7550,\n",
       " 4614,\n",
       " 7447,\n",
       " 4936,\n",
       " 1198,\n",
       " 4424,\n",
       " 5443,\n",
       " 5186,\n",
       " 7103,\n",
       " 248,\n",
       " 7467,\n",
       " 2161,\n",
       " 1621,\n",
       " 8536,\n",
       " 4564,\n",
       " 6284,\n",
       " 8058,\n",
       " 4508,\n",
       " 3932,\n",
       " 9585,\n",
       " 8981,\n",
       " 9386,\n",
       " 9567,\n",
       " 8269,\n",
       " 1550,\n",
       " 1693,\n",
       " 3692,\n",
       " 6753,\n",
       " 1764,\n",
       " 3285,\n",
       " 8642,\n",
       " 3095,\n",
       " 3601,\n",
       " 3792,\n",
       " 4988,\n",
       " 1071,\n",
       " 6930,\n",
       " 8661,\n",
       " 5940,\n",
       " 997,\n",
       " 9537,\n",
       " 507,\n",
       " 7925,\n",
       " 8572,\n",
       " 3107,\n",
       " 7295,\n",
       " 4924,\n",
       " 4515,\n",
       " 8266,\n",
       " 1295,\n",
       " 4056,\n",
       " 5454,\n",
       " 5220,\n",
       " 3370,\n",
       " 10053,\n",
       " 8900,\n",
       " 7382,\n",
       " 3211,\n",
       " 2760,\n",
       " 4640,\n",
       " 7781,\n",
       " 10147,\n",
       " 7750,\n",
       " 9918,\n",
       " 5745,\n",
       " 3727,\n",
       " 5558,\n",
       " 9033,\n",
       " 7287,\n",
       " 2443,\n",
       " 8540,\n",
       " 6958,\n",
       " 8949,\n",
       " 1625,\n",
       " 2813,\n",
       " 7639,\n",
       " 393,\n",
       " 7564,\n",
       " 8720,\n",
       " 9929,\n",
       " 4926,\n",
       " 4826,\n",
       " 2322,\n",
       " 3575,\n",
       " 6514,\n",
       " 6128,\n",
       " 8817,\n",
       " 9455,\n",
       " 4875,\n",
       " 5378,\n",
       " 5283,\n",
       " 2689,\n",
       " 5861,\n",
       " 2444,\n",
       " 5187,\n",
       " 5886,\n",
       " 1882,\n",
       " 8776,\n",
       " 1507,\n",
       " 8684,\n",
       " 9843,\n",
       " 4209,\n",
       " 3003,\n",
       " 6390,\n",
       " 5367,\n",
       " 4195,\n",
       " 2687,\n",
       " 2884,\n",
       " 2976,\n",
       " 9919,\n",
       " 5223,\n",
       " 7347,\n",
       " 1829,\n",
       " 6193,\n",
       " 7307,\n",
       " 1499,\n",
       " 3372,\n",
       " 5321,\n",
       " 8386,\n",
       " 6143,\n",
       " 3155,\n",
       " 4330,\n",
       " 5660,\n",
       " 2547,\n",
       " 8849,\n",
       " 8820,\n",
       " 1762,\n",
       " 3314,\n",
       " 8899,\n",
       " 10123,\n",
       " 5830,\n",
       " 1339,\n",
       " 8762,\n",
       " 2121,\n",
       " 4545,\n",
       " 1763,\n",
       " 9863,\n",
       " 7087,\n",
       " 7469,\n",
       " 261,\n",
       " 8651,\n",
       " 9357,\n",
       " 2119,\n",
       " 4808,\n",
       " 9476,\n",
       " 2469,\n",
       " 3951,\n",
       " 1104,\n",
       " 8285,\n",
       " 8706,\n",
       " 9383,\n",
       " 785,\n",
       " 9378,\n",
       " 4310,\n",
       " 5693,\n",
       " 9688,\n",
       " 5703,\n",
       " 4256,\n",
       " 2155,\n",
       " 8076,\n",
       " 1413,\n",
       " 5617,\n",
       " 8552,\n",
       " 6021,\n",
       " 2872,\n",
       " 6544,\n",
       " 1232,\n",
       " 7596,\n",
       " 1313,\n",
       " 8760,\n",
       " 3884,\n",
       " 4795,\n",
       " 8347,\n",
       " 8799,\n",
       " 8381,\n",
       " 9284,\n",
       " 6595,\n",
       " 10049,\n",
       " 10072,\n",
       " 2572,\n",
       " 8791,\n",
       " 5850,\n",
       " 1225,\n",
       " 3259,\n",
       " 891,\n",
       " 2223,\n",
       " 6387,\n",
       " 6434,\n",
       " 2926,\n",
       " 6091,\n",
       " 5710,\n",
       " 9252,\n",
       " 464,\n",
       " 1967,\n",
       " 4920,\n",
       " 3992,\n",
       " 5387,\n",
       " 7844,\n",
       " 5733,\n",
       " 1769,\n",
       " 4832,\n",
       " 8159,\n",
       " 1899,\n",
       " 8178,\n",
       " 9397,\n",
       " 8986,\n",
       " 9737,\n",
       " 1657,\n",
       " 3047,\n",
       " 9722,\n",
       " 7381,\n",
       " 7407,\n",
       " 1005,\n",
       " 8544,\n",
       " 2362,\n",
       " 964,\n",
       " 2485,\n",
       " 8473,\n",
       " 3818,\n",
       " 4642,\n",
       " 6931,\n",
       " 2787,\n",
       " 9903,\n",
       " 3796,\n",
       " 5750,\n",
       " 2581,\n",
       " 4438,\n",
       " 504,\n",
       " 2373,\n",
       " 10156,\n",
       " 6283,\n",
       " 128,\n",
       " 2986,\n",
       " 8243,\n",
       " 1926,\n",
       " 736,\n",
       " 7822,\n",
       " 6046,\n",
       " 1423,\n",
       " 2051,\n",
       " 4668,\n",
       " 8489,\n",
       " 560,\n",
       " 10140,\n",
       " 5386,\n",
       " 6925,\n",
       " 3662,\n",
       " 3321,\n",
       " 4298,\n",
       " 9399,\n",
       " 2374,\n",
       " 403,\n",
       " 8276,\n",
       " 9138,\n",
       " 2355,\n",
       " 2767,\n",
       " 7983,\n",
       " 5472,\n",
       " 3850,\n",
       " 4017,\n",
       " 10135,\n",
       " 794,\n",
       " 5469,\n",
       " 9032,\n",
       " 9977,\n",
       " 1315,\n",
       " 1227,\n",
       " 4165,\n",
       " 7450,\n",
       " 1893,\n",
       " 2954,\n",
       " 2078,\n",
       " 9732,\n",
       " 6214,\n",
       " 3834,\n",
       " 1261,\n",
       " 7576,\n",
       " 7334,\n",
       " 9047,\n",
       " 9027,\n",
       " 663,\n",
       " 262,\n",
       " 6884,\n",
       " 6402,\n",
       " 7315,\n",
       " 8798,\n",
       " 1337,\n",
       " 1434,\n",
       " 6575,\n",
       " 6036,\n",
       " 494,\n",
       " 4707,\n",
       " 9999,\n",
       " 1920,\n",
       " 2938,\n",
       " 5142,\n",
       " 3822,\n",
       " 9091,\n",
       " 6560,\n",
       " 9684,\n",
       " 10139,\n",
       " 3632,\n",
       " 9229,\n",
       " 6509,\n",
       " 8755,\n",
       " 616,\n",
       " 9851,\n",
       " 1438,\n",
       " 6870,\n",
       " 4001,\n",
       " 65,\n",
       " 6920,\n",
       " 6420,\n",
       " 9518,\n",
       " 6001,\n",
       " 4925,\n",
       " 2063,\n",
       " 4015,\n",
       " 2885,\n",
       " 4519,\n",
       " 1547,\n",
       " 847,\n",
       " 6478,\n",
       " 6715,\n",
       " 5572,\n",
       " 575,\n",
       " 305,\n",
       " 7847,\n",
       " 8758,\n",
       " 3380,\n",
       " 7095,\n",
       " 6499,\n",
       " 4392,\n",
       " 4518,\n",
       " 5884,\n",
       " 3757,\n",
       " 221,\n",
       " 6803,\n",
       " 5737,\n",
       " 7672,\n",
       " 6105,\n",
       " 686,\n",
       " 3205,\n",
       " 9891,\n",
       " 4070,\n",
       " 9259,\n",
       " 8018,\n",
       " 7444,\n",
       " 1367,\n",
       " 6778,\n",
       " 638,\n",
       " 1782,\n",
       " 5381,\n",
       " 764,\n",
       " 6064,\n",
       " 3683,\n",
       " 1051,\n",
       " 7882,\n",
       " 2029,\n",
       " 1498,\n",
       " 9517,\n",
       " 7905,\n",
       " 8365,\n",
       " 6139,\n",
       " 303,\n",
       " 788,\n",
       " 2309,\n",
       " 7278,\n",
       " 5083,\n",
       " 2072,\n",
       " 1100,\n",
       " 5913,\n",
       " 8482,\n",
       " 4778,\n",
       " 2359,\n",
       " 1836,\n",
       " 6460,\n",
       " 2720,\n",
       " 1243,\n",
       " 7251,\n",
       " 9394,\n",
       " 5942,\n",
       " 2073,\n",
       " 3830,\n",
       " 7074,\n",
       " 2641,\n",
       " 6453,\n",
       " 1781,\n",
       " 6346,\n",
       " 5369,\n",
       " 3555,\n",
       " 613,\n",
       " 6757,\n",
       " 8120,\n",
       " 2151,\n",
       " 800,\n",
       " 8216,\n",
       " 9446,\n",
       " 7106,\n",
       " 246,\n",
       " 8476,\n",
       " 4324,\n",
       " 5764,\n",
       " 6109,\n",
       " 120,\n",
       " 1386,\n",
       " 5150,\n",
       " 4403,\n",
       " 4882,\n",
       " 8106,\n",
       " 6948,\n",
       " 8813,\n",
       " 1193,\n",
       " 9363,\n",
       " 1463,\n",
       " 2215,\n",
       " 8298,\n",
       " 4931,\n",
       " 3980,\n",
       " 99,\n",
       " 3813,\n",
       " 6096,\n",
       " 1473,\n",
       " 6869,\n",
       " 6494,\n",
       " 4998,\n",
       " 2458,\n",
       " 5494,\n",
       " 1249,\n",
       " 2879,\n",
       " 3881,\n",
       " 3763,\n",
       " 4769,\n",
       " 497,\n",
       " 10034,\n",
       " 1075,\n",
       " 9413,\n",
       " 6917,\n",
       " 4675,\n",
       " 9983,\n",
       " 5875,\n",
       " 1586,\n",
       " 631,\n",
       " 931,\n",
       " 4950,\n",
       " 6919,\n",
       " 2701,\n",
       " 3191,\n",
       " 3065,\n",
       " 10169,\n",
       " 9827,\n",
       " 9609,\n",
       " 7433,\n",
       " 148,\n",
       " 9818,\n",
       " 1185,\n",
       " 5324,\n",
       " 3355,\n",
       " 3729,\n",
       " 9697,\n",
       " 1792,\n",
       " 1090,\n",
       " 7949,\n",
       " 10069,\n",
       " 5968,\n",
       " 5026,\n",
       " 8474,\n",
       " 5922,\n",
       " 8600,\n",
       " 8040,\n",
       " 283,\n",
       " 9686,\n",
       " 3633,\n",
       " 2481,\n",
       " 5615,\n",
       " 4583,\n",
       " 3617,\n",
       " 2504,\n",
       " 5962,\n",
       " 2856,\n",
       " 4206,\n",
       " 50,\n",
       " 1984,\n",
       " 3868,\n",
       " 1179,\n",
       " 8702,\n",
       " 6117,\n",
       " 4610,\n",
       " 1871,\n",
       " 1911,\n",
       " 5959,\n",
       " 4073,\n",
       " 308,\n",
       " 5972,\n",
       " 4521,\n",
       " 4287,\n",
       " 7529,\n",
       " 873,\n",
       " 2101,\n",
       " 353,\n",
       " 4733,\n",
       " 7855,\n",
       " 5606,\n",
       " 4567,\n",
       " 475,\n",
       " 3330,\n",
       " 7913,\n",
       " 4709,\n",
       " 4362,\n",
       " 4259,\n",
       " 9764,\n",
       " 4577,\n",
       " 7401,\n",
       " 7666,\n",
       " 9312,\n",
       " 365,\n",
       " 3310,\n",
       " 142,\n",
       " 9211,\n",
       " 8369,\n",
       " 3746,\n",
       " 7616,\n",
       " 9042,\n",
       " 4943,\n",
       " 2268,\n",
       " 3758,\n",
       " 8063,\n",
       " 8768,\n",
       " 9695,\n",
       " 2407,\n",
       " 4840,\n",
       " 3859,\n",
       " 531,\n",
       " 8657,\n",
       " 309,\n",
       " 367,\n",
       " 700,\n",
       " 6623,\n",
       " 9172,\n",
       " 10117,\n",
       " 4654,\n",
       " 4006,\n",
       " 7396,\n",
       " 9626,\n",
       " 710,\n",
       " 5560,\n",
       " 10134,\n",
       " 3922,\n",
       " 9000,\n",
       " 8455,\n",
       " 9616,\n",
       " 1951,\n",
       " 452,\n",
       " 6526,\n",
       " 2980,\n",
       " 9877,\n",
       " 8694,\n",
       " 9225,\n",
       " 3988,\n",
       " 9539,\n",
       " 2099,\n",
       " 740,\n",
       " 2057,\n",
       " 10125,\n",
       " 7108,\n",
       " 5119,\n",
       " 7984,\n",
       " 8653,\n",
       " 5845,\n",
       " 9415,\n",
       " 1819,\n",
       " 5577,\n",
       " 231,\n",
       " 3188,\n",
       " 2906,\n",
       " 8318,\n",
       " 6257,\n",
       " 2830,\n",
       " 2316,\n",
       " 9481,\n",
       " 6986,\n",
       " 1917,\n",
       " 2308,\n",
       " 1065,\n",
       " 4681,\n",
       " 5310,\n",
       " 7060,\n",
       " 8874,\n",
       " 9644,\n",
       " 8525,\n",
       " 7209,\n",
       " 9719,\n",
       " 1898,\n",
       " 2244,\n",
       " 103,\n",
       " 3602,\n",
       " 7150,\n",
       " 5461,\n",
       " 8066,\n",
       " 8726,\n",
       " 3926,\n",
       " 1968,\n",
       " 5149,\n",
       " 6527,\n",
       " 1779,\n",
       " 6662,\n",
       " 1875,\n",
       " 6251,\n",
       " 10090,\n",
       " 371,\n",
       " 1957,\n",
       " 4962,\n",
       " 9938,\n",
       " 4644,\n",
       " 8522,\n",
       " 634,\n",
       " 7388,\n",
       " 5725,\n",
       " 7692,\n",
       " 10011,\n",
       " 1008,\n",
       " 2320,\n",
       " 9134,\n",
       " 2614,\n",
       " 4695,\n",
       " 5091,\n",
       " 9577,\n",
       " 9750,\n",
       " 7241,\n",
       " 1573,\n",
       " 5776,\n",
       " 7572,\n",
       " 151,\n",
       " 10102,\n",
       " 9960,\n",
       " 555,\n",
       " 29,\n",
       " 5810,\n",
       " 7926,\n",
       " 3814,\n",
       " 6835,\n",
       " 9060,\n",
       " 7084,\n",
       " 2039,\n",
       " 5664,\n",
       " 7485,\n",
       " 721,\n",
       " 6828,\n",
       " 8773,\n",
       " 9475,\n",
       " 3144,\n",
       " 3994,\n",
       " 10112,\n",
       " 2754,\n",
       " 2788,\n",
       " 2744,\n",
       " 6154,\n",
       " 2412,\n",
       " 9365,\n",
       " 1827,\n",
       " 923,\n",
       " 8633,\n",
       " 6271,\n",
       " 5683,\n",
       " 6611,\n",
       " 519,\n",
       " 1403,\n",
       " 7571,\n",
       " 5412,\n",
       " 8731,\n",
       " 6259,\n",
       " 7852,\n",
       " 4294,\n",
       " 2748,\n",
       " 2991,\n",
       " 7239,\n",
       " 5542,\n",
       " 5440,\n",
       " 6993,\n",
       " 988,\n",
       " 9024,\n",
       " 3037,\n",
       " 7842,\n",
       " 6566,\n",
       " 3523,\n",
       " 5718,\n",
       " 9392,\n",
       " 2226,\n",
       " 7181,\n",
       " 1517,\n",
       " 6994,\n",
       " 6762,\n",
       " 3271,\n",
       " 5397,\n",
       " 5904,\n",
       " 8309,\n",
       " 7581,\n",
       " 7002,\n",
       " 8803,\n",
       " 5691,\n",
       " 8727,\n",
       " 436,\n",
       " 7495,\n",
       " 7079,\n",
       " 2389,\n",
       " 10051,\n",
       " 9168,\n",
       " 9385,\n",
       " 10064,\n",
       " 7479,\n",
       " 1511,\n",
       " 2974,\n",
       " 1462,\n",
       " 8967,\n",
       " 2965,\n",
       " 5066,\n",
       " 9962,\n",
       " 4078,\n",
       " 3804,\n",
       " 2233,\n",
       " 5659,\n",
       " 7422,\n",
       " 3640,\n",
       " 3787,\n",
       " 4796,\n",
       " 7376,\n",
       " 645,\n",
       " 5414,\n",
       " 6550,\n",
       " 3242,\n",
       " 7152,\n",
       " 4237,\n",
       " 2204,\n",
       " 5308,\n",
       " 2321,\n",
       " 3699,\n",
       " 3238,\n",
       " 2841,\n",
       " 7553,\n",
       " 5674,\n",
       " 3911,\n",
       " 10065,\n",
       " 1290,\n",
       " 5794,\n",
       " 8185,\n",
       " 4595,\n",
       " 2361,\n",
       " 5498,\n",
       " 6111,\n",
       " 9417,\n",
       " 10152,\n",
       " 3503,\n",
       " 9125,\n",
       " 4434,\n",
       " 1157,\n",
       " 1725,\n",
       " 789,\n",
       " 4373,\n",
       " 5638,\n",
       " 1275,\n",
       " 9309,\n",
       " 9969,\n",
       " 7902,\n",
       " 3178,\n",
       " 7595,\n",
       " 1082,\n",
       " 1759,\n",
       " 6294,\n",
       " 5986,\n",
       " 9283,\n",
       " 465,\n",
       " 6688,\n",
       " 7161,\n",
       " 2405,\n",
       " 4922,\n",
       " 6457,\n",
       " 9800,\n",
       " 6562,\n",
       " 8458,\n",
       " 6281,\n",
       " 7563,\n",
       " 7975,\n",
       " 7801,\n",
       " 1098,\n",
       " 8233,\n",
       " 4527,\n",
       " 6045,\n",
       " 1355,\n",
       " 4889,\n",
       " 389,\n",
       " 4731,\n",
       " 2453,\n",
       " 1934,\n",
       " 782,\n",
       " 4372,\n",
       " 3340,\n",
       " 4402,\n",
       " 8303,\n",
       " 621,\n",
       " 8436,\n",
       " 3018,\n",
       " 5550,\n",
       " 3007,\n",
       " 7607,\n",
       " 8724,\n",
       " 7117,\n",
       " 3386,\n",
       " 615,\n",
       " 8672,\n",
       " 2508,\n",
       " 9427,\n",
       " 6704,\n",
       " 7751,\n",
       " 1971,\n",
       " 6882,\n",
       " 2026,\n",
       " 7763,\n",
       " 3775,\n",
       " 3257,\n",
       " 10114,\n",
       " 2763,\n",
       " 6043,\n",
       " 1877,\n",
       " 8701,\n",
       " 5395,\n",
       " 7163,\n",
       " 9050,\n",
       " 7760,\n",
       " 4907,\n",
       " 3388,\n",
       " 2,\n",
       " 2468,\n",
       " 59,\n",
       " 7796,\n",
       " 4975,\n",
       " 5258,\n",
       " 9880,\n",
       " 8438,\n",
       " 6418,\n",
       " 9901,\n",
       " 8168,\n",
       " 6114,\n",
       " 3584,\n",
       " 4327,\n",
       " 3216,\n",
       " 4848,\n",
       " 8450,\n",
       " 8423,\n",
       " 811,\n",
       " 5303,\n",
       " 1533,\n",
       " 3569,\n",
       " 9618,\n",
       " 5403,\n",
       " 3318,\n",
       " 2106,\n",
       " 3431,\n",
       " 7860,\n",
       " 7546,\n",
       " 4262,\n",
       " 7533,\n",
       " 7323,\n",
       " 7446,\n",
       " 4845,\n",
       " 4974,\n",
       " 3108,\n",
       " 4045,\n",
       " 3452,\n",
       " 5751,\n",
       " 7857,\n",
       " 4082,\n",
       " 1864,\n",
       " 2265,\n",
       " 9636,\n",
       " 8652,\n",
       " 1279,\n",
       " 4660,\n",
       " 4973,\n",
       " 9700,\n",
       " 5133,\n",
       " 8808,\n",
       " 8809,\n",
       " 3298,\n",
       " 9666,\n",
       " 4090,\n",
       " 9571,\n",
       " 3036,\n",
       " 6303,\n",
       " 6141,\n",
       " 6002,\n",
       " 5391,\n",
       " 9906,\n",
       " 4465,\n",
       " 4304,\n",
       " 9935,\n",
       " 9530,\n",
       " 4188,\n",
       " 8008,\n",
       " 7198,\n",
       " 7577,\n",
       " 3608,\n",
       " 5202,\n",
       " 7062,\n",
       " 6280,\n",
       " 10096,\n",
       " 728,\n",
       " 5330,\n",
       " 6602,\n",
       " 2762,\n",
       " 3986,\n",
       " 3023,\n",
       " 45,\n",
       " 9153,\n",
       " 5207,\n",
       " 6935]"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "trainval = random.sample(list, tv)\n",
    "train = random.sample(trainval, tr)\n",
    "train"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "ftrainval = open('ImageSets/Main/trainval.txt', 'w')\n",
    "ftest = open('ImageSets/Main/test.txt', 'w')\n",
    "ftrain = open('ImageSets/Main/train.txt', 'w')\n",
    "fval = open('ImageSets/Main/val.txt', 'w')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "for i in list:\n",
    "    name = total_xml[i][:-4] + '\\n'\n",
    "    if i in trainval:\n",
    "        ftrainval.write(name)\n",
    "        if i in train:\n",
    "            ftest.write(name)\n",
    "        else:\n",
    "            fval.write(name)\n",
    "    else:\n",
    "        ftrain.write(name)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "ftrainval.close()\n",
    "ftrain.close()\n",
    "fval.close()\n",
    "ftest.close()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
